﻿using GuanQL.Core.Domain.Accounts;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using System;
using System.Security.Claims;

namespace GuanQL.Core.Stores
{
    public class GQLRoleStore : RoleStore<Role, GQLDbContext, Guid, UserRole, IdentityRoleClaim<Guid>>
    {
        public GQLRoleStore(GQLDbContext context) : base(context)
        {
        }

        protected override IdentityRoleClaim<Guid> CreateRoleClaim(Role role, Claim claim)
        {
            return new IdentityRoleClaim<Guid> { RoleId = role.Id, ClaimType = claim.Type, ClaimValue = claim.Value };
        }
    }
}
